<!--
 * @Author: your name
 * @Date: 2021-08-04 15:37:16
 * @LastEditTime: 2021-08-04 17:09:03
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vuestudy\vue\15-组件\组件-1.html
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <!-- 注意一定是先引入vue.js文件，再引入组件的js文件 -->
    <script src="./components/mycount.js"></script>
    <link rel="stylesheet" href="./css/common.css" />
  </head>
  <body>
    <!-- 组件的作用：代码的重复利用 -->
    <!-- 组件的定义 ：局部组件+全局组件-->
    <!-- 一个组件就是一个小型的vue实例，vue实例里面可以写的内容 都可以写在组件里面-->
    <div id="app">
      <!-- count="20"这样写传给组件的20是字符串 -->
      <b-count count="20"></b-count>
      <!-- :count="20"表示将变量abc的值传给count参数 -->
      <b-count :count="20"></b-count>
    </div>

    <script>
      // 全局可以真个新建
      new Vue({
        el: "#app",
        data() {
          return {};
        },
      });
    </script>
  </body>
</html>
